﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NETXPF.Library
{
    public class ProcessLaunch
    {
        public static void Web(string url)
        {
            System.Diagnostics.Process p = Start(url);
            if (p != null)
            {
                p.Close();
            }
        }
        public static System.Diagnostics.Process Start(string path)
        {
            System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(path);
            psi.UseShellExecute = true;
            return System.Diagnostics.Process.Start(psi);
        }
        public static System.Diagnostics.Process Start(string path, string args)
        {
            System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(path, args);
            psi.UseShellExecute = true;
            return System.Diagnostics.Process.Start(psi);
        }
        public static System.Diagnostics.Process Start(System.Diagnostics.ProcessStartInfo psi)
        {
            psi.UseShellExecute = true;
            return System.Diagnostics.Process.Start(psi);
        }
    }
}
